import Vue from "vue";
import Vuex from "vuex";
import user from "./modules/user.js";
import doctor from "./modules/doctor.js";
import createPersistedState from "vuex-persistedstate";
import DoctorList from "./modules/doctor-list.js";
import collectList from "./modules/collectList.js";
Vue.use(Vuex);

export default new Vuex.Store({
  plugins: [
    createPersistedState(
      // 配置将vuex的状态储存到sessionStorage中（默认储存到localStorage中）
      {
        storage: window.localStorage,
      }
    ),
  ],
  state: {},
  getters: {},
  mutations: {},
  actions: {},
  modules: {
    DoctorList,
    user,
    doctor,
    collectList,
  },
});
